script_enemy_main
{
        let csd     = GetCurrentScriptDirectory;
	let speed = GetSpeed;
	let angle = GetAngle;
	let num = GetArgument;
	let imgEnemy;
	if(num==1)
	{
		imgEnemy=csd~"..\lib\fairy_red.png";
	}
	if(num==2)
	{
		imgEnemy=csd~"..\lib\fairy_blue.png";
	}

	let imgCircle=csd~"..\img\circle.png";
	let SelectedDifficult=GetCommonDataDefault("SELECTEDDIFFICULT","Normal");

    @Initialize {
        SetLife(220);
        SetDamageRate(100,100);
	SetTexture(imgEnemy);
	Initialize_Fairy(3);
	Tmain;
	}

    @MainLoop {
	SetCollisionA(GetX(),GetY(),48);
	yield;
    }

        @DrawLoop {
		SetGraphicScale(1,1);
		SetColor(ZakoColor[0],ZakoColor[1],ZakoColor[2]);
		DrawFairy(imgEnemy);
		SetTexture(imgCircle);
		SetGraphicRect(256,256,512,512);
		SetGraphicScale(0.3,0.3);
		SetColor(ZakoMagicColor[0],ZakoMagicColor[1],ZakoMagicColor[2]);
		DrawGraphic(GetX,GetY);
	}

        @Finalize
        {
		FinalizeItemSet(2);
		alternative(GetCommonDataDefault("SELECTEDDIFFICULT","None"))
		case("Moderate")
		{
			ReturnBurstShotnum(10);
		}
		case("Extream")
		{
			ReturnBurstShotnum(10);
			ReturnPowerShotnum(5);
		}
		case("Apocalypse")
		{
			ReturnBurstShotnum(10);
		}
        } 

task Tmain
{
yield;
OutDamageRateZero;
AutoErazeTime(1200);
GetDamege;
MagicColor;
move;

alternative(GetCommonDataDefault("SELECTEDDIFFICULT","None"))
case("Moderate")
{
shotM;
}
case("Extream")
{
shotE;
}
case("Apocalypse")
{
shotA;
}

}


task move
{
	SetSpeed(GetSpeed);
	SetAngle(GetAngle);
}

task shotM
{
wait(60);
loop(4)
{
loop(5)
{
ascent(let i in -2..3)
{
	GroundCreateShot01(GetX,GetY,4.0,GetAngleToPlayer+i*2,9,5);
}
wait(6);
}

wait(60);
}
}
///////////////////////////////////////////////
task shotE
{
wait(60);
loop(5)
{
loop(5)
{
ascent(let i in -4..5)
{
	GroundCreateShot01(GetX,GetY,4.5,GetAngleToPlayer+i*3,9,5);
}
wait(6);
}

wait(45);
}
}
/////////////////////////////////////////////////
task shotA
{
wait(60);
loop(5)
{
loop(5)
{
ascent(let i in -8..9)
{
	GroundCreateShot01(GetX,GetY,4.5,GetAngleToPlayer+i*3,9,5);
}
wait(6);
}

wait(45);
}
}

#include_function ".\..\txt/StageEnemydata.txt"
#include_function ".\..\lib\lib_anime_fairy.txt"
}

#include_script ".\..\txt/EnemyShotData.txt"